#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
int main()
{
	pid_t id = fork();
	if(id == 0)
	{
		int cnt = 5;
		while(cnt)
		{
			printf("this is child,cnt:%d,pid:%d\n",cnt,getpid());
			sleep(1);
			cnt--;
		}
	}
	else
	{
		while(1)
		{
			printf("this is parent,pid:%d\n",getpid());
			sleep(1);
		}
	}
	return 0;
}
